package mycine.model.dao;

import javax.persistence.Query;
import mycine.model.beans.Usermc;

/**
 *
 * @author Vincent
 */
public class UsermcDAO extends DAO {
	
	public UsermcDAO() {
		em = getEntityManager();
	}
	
	public Usermc login(String emailForm, String passwordForm) {
		Query query = em.createQuery("SELECT u FROM Usermc u WHERE u.email = :email AND u.password = :password");
		query.setParameter("email", emailForm);
		query.setParameter("password", passwordForm);
		
		return (Usermc)query.getSingleResult();
	}
	
}
